from DataManagement.models import DataCenterModel
from gxdm.models import *


class Gxxs0101(DataCenterModel):
    xh = models.CharField(primary_key=True, max_length=32, verbose_name='学号')
    xm = models.CharField(max_length=128, blank=True, null=True, verbose_name='姓名')
    ywxm = models.CharField(max_length=128, blank=True, null=True, verbose_name='英文姓名')
    xmpy = models.CharField(max_length=128, blank=True, null=True, verbose_name='姓名拼音')
    cym = models.CharField(max_length=128, blank=True, null=True, verbose_name='曾用名')
    xbm = models.ForeignKey(Xbdm, to_field='value',  on_delete=models.PROTECT, db_column='xbm', verbose_name='性别', blank=True, null=True)
    csrq = models.DateField(blank=True, null=True, verbose_name='出生日期')
    csdm = models.CharField(max_length=32, blank=True, null=True, verbose_name='出生地码')
    jgm = models.CharField(max_length=32, blank=True, null=True, verbose_name='籍贯')
    mzm = models.ForeignKey(Mzdm, to_field='value',  on_delete=models.PROTECT, db_column='mzm', verbose_name='民族', blank=True, null=True)
    gjdqm = models.CharField(max_length=32, blank=True, null=True, verbose_name='国籍/地区码')
    # sfzjlxm = models.CharField(max_length=32, blank=True, null=True, verbose_name='身份证件类型码')
    sfzjlxm = models.ForeignKey(Sfzjlxdm, to_field='value', related_name='xs_01_sfzjlxm', on_delete=models.PROTECT, db_column='sfzjlxm', verbose_name="身份证件类型", blank=True, null=True)
    sfzjh = models.CharField(max_length=32, blank=True, null=True, verbose_name='身份证件号')
    yhkh = models.CharField(max_length=32, blank=True, null=True, verbose_name='银行卡号')
    hyzkm = models.CharField(max_length=32, blank=True, null=True, verbose_name='婚姻状况码')

    gatqwm = models.CharField(max_length=32, blank=True, null=True, verbose_name='港澳台侨外码')
    zzmmm = models.ForeignKey(Zzmmdm, to_field='value', related_name='xs_01_zzmmm', on_delete=models.PROTECT, db_column='zzmmm', verbose_name="政治面貌", blank=True, null=True)
    jkzkm = models.CharField(max_length=32, blank=True, null=True, verbose_name='健康状况码')
    xyzjm = models.CharField(max_length=32, blank=True, null=True, verbose_name='信仰宗教码')
    xxm = models.CharField(max_length=32, blank=True, null=True, verbose_name='血型码')
    zp = models.CharField(max_length=128, blank=True, null=True, verbose_name='照片')
    sfzjyxq = models.CharField(max_length=32, blank=True, null=True, verbose_name='身份证件有效期')
    sfdszn = models.CharField(max_length=32, blank=True, null=True, verbose_name='是否独生子女')

    def __str__(self):
        return self.xh

    class Meta:
        managed = False
        db_table = 'gxxs0101_2'
        verbose_name = 'GXXS0101 学生基本数据子类表'
        verbose_name_plural = 'GXXS0101 学生基本数据子类表'
